// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   InvisibleFrame.java

package com.boci.clientapp.main;

import com.boci.common.ui.constant.UIConst;
import java.awt.HeadlessException;
import java.awt.Window;
import java.awt.event.WindowEvent;
import java.awt.event.WindowFocusListener;
import javax.swing.JFrame;

public class InvisibleFrame extends JFrame
    implements WindowFocusListener
{

    public static InvisibleFrame getFrame()
    {
        return invisibleFrame;
    }

    public InvisibleFrame()
        throws HeadlessException
    {
        setUndecorated(true);
        setSize(0, 0);
        setIconImage(null);
        setLocation(UIConst.APP_SCREEN_WIDTH / 2, UIConst.APP_SCREEN_HEIGHT / 2);
        addWindowFocusListener(this);
    }

    public static void open()
    {
        if(invisibleFrame == null)
            invisibleFrame = new InvisibleFrame();
        invisibleFrame.setVisible(true);
    }

    public static void close()
    {
        if(invisibleFrame != null)
        {
            invisibleFrame.setVisible(false);
            invisibleFrame.dispose();
        }
    }

    public void windowGainedFocus(WindowEvent e)
    {
        Window win[] = getOwnedWindows();
        for(int i = 0; i < win.length; i++)
            win[i].requestFocus();

    }

    public void windowLostFocus(WindowEvent windowevent)
    {
    }

    private static InvisibleFrame invisibleFrame;
}
